import * as React from 'react'
import './index.less'
import {Link} from 'react-router-dom'
import {connect} from 'react-redux'

import {Session,Store} from '../../store/types'
import actions from '../../store/actions/session'


let profile = require('../../image/下载 (1).png')

interface Props{
  user:any
}
class Profile extends React.Component<Props> {
 
  render() { 
    console.log(this.props.user)
    return ( 
      <div className="profile">
        <div className="profile-bg">
          <img src={profile} alt=""/>
          {
            this.props.user?<a>{this.props.user.username}111111111111</a>: <Link to='/login'>登录</Link>
          }
         
        </div>
      </div>
     );
  }
}
 
export default connect(
  (state:Store):Session => state.session,
  actions

)(Profile) ;